// 此文件是用来发送请求，获取三级分类的接口函数文件

//引入axios配置项对象（axios实例）
import request from '@/utils/request'
// 引入接口
import type {CategoryListModel } from '@/api/product/model/categoryModel'
// 2. 定义枚举
enum Api {
  getCategory1ListApi = '/admin/product/getCategory1',
  getCategory2ListApi = '/admin/product/getCategory2',
  getCategory3ListApi = '/admin/product/getCategory3'
}
// 获取一级分类数据
export const reqGetCategory1ListData = () => {
  return request.get<any,CategoryListModel>(Api.getCategory1ListApi)
}
// 根据一级ID获取二级分类的数据
export const reqGetCategory2ListData = (category1Id:number)=>{
  return request.get<any,CategoryListModel>(Api.getCategory2ListApi+`/${category1Id}`)
}
// 根据二级ID获取三级导航数据
export const reqGetCategory3ListData = (category2Id:number) => {
  return request.get<any,CategoryListModel>(Api.getCategory3ListApi+`/${category2Id}`)
}